import {
	request,
} from '@/api/request';
const apiList = [
	// /api/index/readConfig?configName=""
	{
		name: 'readConfig',
		url: '/api/index/readConfig',
		method: "GET"
	},
	{
		// /api/index/category
		name: 'category',
		url: '/api/index/category',
		method: "GET"
	},
	{
		// /api/index/unfinedOrder
		name: 'unfinedOrder',
		url: '/api/index/unfinedOrder'
	},
	{
		// /api/index/projectList
		name: 'projectList',
		url: '/api/index/projectList'
	},
	{
		// /api/index/infoList
		name: 'infoList',
		url: '/api/index/infoList',
		method:'GET'
	},
	{
		// /api/index/changeStatus
		name: 'changeStatus',
		url: '/api/index/changeStatus'
	}, {
		// /api/index/infoCollect
		name: 'infoCollect',
		url: '/api/index/infoCollect'
	},
	{
		// /api/index/infoDetail
		name: 'infoDetail',
		url: '/api/index/infoDetail',
		method:'GET'
	},
	{
		// /api/index/delInfo
		name: 'delInfo',
		url: '/api/index/delInfo',
	},
	{
		// /api/index/infoShare
		name: 'infoShare',
		url: '/api/index/infoShare',
	},
	{
		// infoDetailNoIncView
		name: 'infoDetailNoIncView',
		url: '/api/index/infoDetailNoIncView',
		method:'GET'
	},
	{
		// /api/info/infoCount
		name: 'infoCount',
		url: '/api/index/infoCount',
		method:'GET'
	},
	{
		name: 'editInfo',
		url: '/api/index/editInfo'
	},
	{
		// /api/user/unReadCount
		name: 'unReadCount',
		url: '/api/user/unReadCount',
		method:'GET'
	},
	{
		// /api/index/infoList
		name: 'infoList',
		url: '/api/index/infoList',
		method:'GET'
	},
	{
		// /api/index/getInitData
		name: 'getInitData',
		url: '/api/index/getInitData',
		method:'GET'
	},
	{
		// /api/index/undifineOrderType
		name: 'undifineOrderType',
		url: '/api/index/undifineOrderType',
	},
	{
		// /api/index/sizeIndex
		name: 'sizeIndex',
		url: '/api/index/sizeIndex',
		method:'GET'
	},
	{
		// /api/index/myOrderTypeAdmin
		name: 'myOrderTypeAdmin',
		url: '/api/index/myOrderTypeAdmin',
		method:'GET'
	},
	{
		// /api/index/orderTypeAdminInfo?id=1
		name: 'orderTypeAdminInfo',
		url: '/api/index/orderTypeAdminInfo',
		method:'GET'
	},
	{
		// indexcode
		name: 'indexcode',
		url: '/api/index/indexcode',
		err:true
	},
	{
		// createcodeUse
		name: 'createcodeUse',
		url: '/api/index/createcodeUse',
		
	}
]

module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data) => request({
		url: params.url,
		method: params.method || 'POST',
		data
	})
	return mode
}, {})